fix: template authentication issue #1939
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GitHub Template Authentication Fix
🎯 Problem
The GitHub template API was failing with a 403 Forbidden error when trying to fetch templates like
xKevIsDev/vanilla-vite-template. The issue was caused by an environment variable name mismatch between what the API expected (GITHUB_TOKEN) and what was configured in the environment (VITE_GITHUB_ACCESS_TOKEN).🔧 Solution
Updated the GitHub template API to support both environment variable naming conventions for better compatibility:
✅ Changes Made
app/routes/api.github-template.tsVITE_GITHUB_ACCESS_TOKENenvironment variable🧪 Testing
xKevIsDev/vanilla-vite-templatenow returns 10 files (was failing before)xKevIsDev/bolt-vite-react-ts-templateworks correctly (16 files returned)🎉 Benefits
GITHUB_TOKENandVITE_GITHUB_ACCESS_TOKEN📋 Templates Affected
This fix improves authentication for all GitHub-based templates including:
The fix is ready to merge and will immediately resolve the template fetching issues users were experiencing! 🚀
Note: This is a safe, backward-compatible change that only improves authentication without affecting any other functionality.